﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ParseXmlForm.aspx.cs" Inherits="Cms.Web.UIBuilder.ParseXmlForm"
    EnableViewState="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script src="../Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="../Scripts/core.js" type="text/javascript"></script>

    <asp:PlaceHolder id="GlabHeader" runat="server"></asp:PlaceHolder>

    <script type="text/javascript">
        function GetLayoutSetting(objid) {
            var layoutSettings = {
                Dock: $.layoutEngine.DOCK.FILL,
                EleID: objid,
                Children: []
            };
            var docklist = $("#" + objid + " .dock");
            docklist.each(function() {
                var self = $(this);
                var d = self.attr("dock");
                var id = self.attr("id");
                var s = { EleID: id };
                var jquerydock = null;
                if (d)
                    switch (d.toLowerCase()) {
                    case "top":
                        jquerydock = $.layoutEngine.DOCK.TOP;
                        s.Height = self.height();
                        break;
                    case "left":
                        jquerydock = $.layoutEngine.DOCK.LEFT;
                        s.Width = self.width();
                        break;
                    case "fill":
                        jquerydock = $.layoutEngine.DOCK.FILL;
                        break;
                    case "right":
                        jquerydock = $.layoutEngine.DOCK.RIGHT;
                        s.Width = self.width();
                        break;
                    case "bottom":
                        jquerydock = $.layoutEngine.DOCK.BOTTOM;
                        s.Height = self.height();
                        break;
                    default:
                        jquerydock = $.layoutEngine.DOCK.FILL;
                        break;
                }
                s.Dock = jquerydock;
                layoutSettings.Children.push(s);
            });
            return layoutSettings;
        }
        $(document).ready(function() {
            if (typeof (Requires) != "undefined" && Requires && Requires.join(",").indexOf("dock") > -1) {
                var layoutSettings = GetLayoutSetting("dhtml");
                if (layoutSettings && layoutSettings.Children.length > 0) {
                    $.layoutEngine(layoutSettings);
                }
            }
            if (jqGridList.length > 0) {
                var w = GetInnerWidth();
                for (var i = 0; i < jqGridList.length; i++)
                    eval("InitGrid_" + jqGridList[i]["id"] + "(" + w + ",150)");
            }
            $(".richeditor").each(function() {
                var name = $("textarea", this).attr("name");
                var w = $(this).width();
                var h = $(this).height();
                KindEditor.create("textarea[name='" + name + "']", { resizeType: 1 ,width:w,height:h});
            });

        });
        function GridRowSelect(gridid, selid) { }
        function gridcomplete(gridid) {
            // debugger;
            var ph = $("#div_" + gridid).height() - 60;
            var pw = $("#div_" + gridid).width() - 10
            $("#" + gridid).setGridHeight(ph).setGridWidth(pw);
        }
    </script>

    <style type="text/css">
        html, body, *
        {
            font-size: 12px;
        }
        #dhtml
        {
            position: relative;
        }
        .input, .label, .combobox, .richeditor, .grid, .button,.checkbox
        {
            position: absolute;
        }
        .label
        {
            width: 100px;
        }
        .input
        {
            width: 118px;
            height:20px;
        }
        .input *
        {
            width: 100%;
            height: auto;
            border: 1px solid #ccc;
        }
        .combobox
        {
            width: 150px;
        }
        .combobox select
        {
            width: 100%;
            height: auto;
            border: 1px solid #ccc;
        }
        .richeditor
        {
        }
        .richeditor textarea
        {
            width: 100%;
            height: 100%;
            overflow-y: auto;
            padding: 0;
            border: 1px solid gray;
        }
        .group
        {
            width: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="dhtml" runat="server">
    </div>
    </form>
</body>
</html>
